<!DOCTYPE html>
<html>
<head>
	<% include ../link %>
</head>
<body>
	<% include ../head %>
	<% include ../subtitle %>
	<div class="container">
		<div class="row" style="margin-bottom: 20px;">
		</div>
	</div>
	<div class="container">
		<h3>&nbsp;&nbsp;<%-title%><small>...</small></h3>
		<div class="row" data-bind="foreach: videos">
			<div class="col-sm-6 col-md-3">
				<a class="views" target="_blank" data-bind="attr: { href: url}">
					<img class="index-bg-img" style="width:100%;" data-bind="attr: { src : img}">
					<div class="caption">
						<p title="" data-bind="text: name, attr: { title : info}"></p>
					</div>
				</a>
			</div>
		</div>
	</div>
	<% include ../foot %>
</body>
<script>
	var video = '<%- JSON.stringify(video)%>';
	video = JSON.parse(video);
	function ViewModel(v){
		var self = this;
		self.videos = ko.observableArray();
	}

	function videoModel(o){
		var self = this;
		self.name = o.name;
		self.url = '/video/av/'+o.id;
		self.img = o.img;
		self.id = o.id;
		self.upUser = o.upUser;
		self.upTime = o.upTime;
		self.info = o.info;
	}

	var vm = new ViewModel();

	for (var i = 0; i < video.length; i++) {
		vm.videos.push(new videoModel(video[i]));
	}

	ko.applyBindings(vm)
</script>
</html>